package edu.gdut.thesissys.vo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * SecondTeacher entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "second_teacher", catalog = "gdutmis")
public class SecondTeacher extends BaseVo implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 3737708539561246192L;
	private Integer secondTeacherId;
	private String name;
	private String duty;
	private String unit;
	private String outSchool;
	private Set<StudentChooseTitle> studentChooseTitles = new HashSet<StudentChooseTitle>(
			0);

	// Constructors

	/** default constructor */
	public SecondTeacher() {
	}

	/** minimal constructor */
	public SecondTeacher(String name) {
		this.name = name;
	}

	/** full constructor */
	public SecondTeacher(String name, String duty, String unit,
			String outSchool, Set<StudentChooseTitle> studentChooseTitles) {
		this.name = name;
		this.duty = duty;
		this.unit = unit;
		this.outSchool = outSchool;
		this.studentChooseTitles = studentChooseTitles;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "second_teacher_id", unique = true, nullable = false)
	public Integer getSecondTeacherId() {
		return this.secondTeacherId;
	}

	public void setSecondTeacherId(Integer secondTeacherId) {
		this.secondTeacherId = secondTeacherId;
	}

	@Column(name = "name", nullable = false, length = 10)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "duty", length = 8)
	public String getDuty() {
		return this.duty;
	}

	public void setDuty(String duty) {
		this.duty = duty;
	}

	@Column(name = "unit", length = 100)
	public String getUnit() {
		return this.unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Column(name = "out_school", length = 1)
	public String getOutSchool() {
		return this.outSchool;
	}

	public void setOutSchool(String outSchool) {
		this.outSchool = outSchool;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "secondTeacher")
	public Set<StudentChooseTitle> getStudentChooseTitles() {
		return this.studentChooseTitles;
	}

	public void setStudentChooseTitles(
			Set<StudentChooseTitle> studentChooseTitles) {
		this.studentChooseTitles = studentChooseTitles;
	}

}